package com.example.tic_tac_toe_in_android.model;

public abstract class Player {
	private String name;
	private boolean myTurn = false;
	private boolean cross = false;
	private Score score = new Score();

	public Player(String name) {
		System.out.println("Player.Player()");
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isMyTurn() {
		return myTurn;
	}

	public void setMyTurn(boolean myTurn) {
		this.myTurn = myTurn;
	}

	public void setCross(boolean cross) {
		this.cross = cross;
	}

	public boolean isCross() {
		return cross;
	}

	public int getScore() {
		return score.getScore();
	}

	public void hasWon() {
		score.addOnePoint();
	}

	@Override
	public String toString() {
		if (getName() != null) {
			String temp = getName() + ": " + getScore();
			return temp;
		}
		return super.toString();
	}

}
